#include <iostream>
#include <signal.h>
using namespace std;
void handler(int sn)
{
    char buffer[1024];
    int n = read(0, buffer, sizeof(buffer)-1);
    buffer[n] = '\0';
    cout<<buffer<<endl;
}
int main()
{
    signal(SIGIO, handler);
    while(1){}
    return 0;
}